<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <title>可视化VGG神经网络分类IMAGENET</title>
  <script type="text/javascript">
        function ProcessFile() {
            var file = document.getElementById('file').files[0];
            if (file) {
                var reader = new FileReader();
                reader.onload = function (event) {
                    var txt = event.target.result;

                    var img = document.createElement("img");
                    img.src = txt;
                    document.getElementById("result").appendChild(img);
                };
            }
            reader.readAsDataURL(file);
        }

        function contentLoaded() {
            document.getElementById('file').addEventListener('change',
                ProcessFile, false);
        }

        window.addEventListener("DOMContentLoaded", contentLoaded, false);


  </script>
</head>

<link rel="icon" type="image/png" href="/static/vgg.ico">

<body>
<form action="/api/imagenet.html" method="post" enctype="multipart/form-data">
  <P>
  <h4>请选取一个图像url链接:</h4>
  <input id="file" name="url" type="text" style="height: 18px; width: 500px">
  <input type="submit" value="提交"><br>

  <h4>您上传的图像为：</h4>
  <img src="/static/imagenet/imagenet.png" alt="" style="height: 512px; width: 512px">

  <h4>类别: {{label}} 概率: {{probability}}%</h4>
</form>
</body>

</html>